// 首页导航条切换
changeMenu = (num) => {
    var dom = document.querySelectorAll(".aaaaaa")[0],
        doms = document.querySelectorAll(".menu");
    dom.className = "menu";
    doms[num].className = "menu aaaaaa";
}

// 轮播部分
var btns = document.getElementsByTagName("button"),
    imgs = document.getElementsByTagName("img"),
    j = 0;
for (var i in btns) {
    btns[i].onclick = function () {
        if (this.innerText == ">") {
            j++;
            j == imgs.length && (j = 0);
            for (var i = 0; i < imgs.length; i++) {
                imgs[i].className = "";
            }
            imgs[j].className = "active";
        } else {
            j--;
            j == -1 && (j = imgs.length - 1);
            for (var i = 0; i < imgs.length; i++) {
                imgs[i].className = "";
            }
            imgs[j].className = "active";
        }
    }
}
timer = setInterval(function () {
    j++;
    j == imgs.length && (j = 0);
    for (var i = 0; i < imgs.length; i++) {
        imgs[i].className = "";
    }
    imgs[j].className = "active";
}, 1000)
carousel.onmouseover = function () {
    clearInterval(timer);
}
carousel.onmouseout = function () {
    timer = setInterval(function () {
        j++;
        j == imgs.length && (j = 0);
        for (var i = 0; i < imgs.length; i++) {
            imgs[i].className = "";
        }
        imgs[j].className = "active";
    }, 1000)
}